package site.linkway.core.mapper;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import site.linkway.core.entity.po.Good;

import java.util.List;

public class GoodsMapperImpl extends SqlSessionDaoSupport implements GoodsMapper {
    @Override
    public List<Good> selectAll() {
        GoodsMapper goodsMapper=getSqlSessionTemplate().getMapper(GoodsMapper.class);
        return goodsMapper.selectAll();
    }

    @Override
    public Good selectById(Good good) {
        GoodsMapper goodsMapper=getSqlSessionTemplate().getMapper(GoodsMapper.class);
        return goodsMapper.selectById(good);
    }

    @Override
    public long add(Good good) {
        GoodsMapper goodsMapper=getSqlSessionTemplate().getMapper(GoodsMapper.class);
        return goodsMapper.add(good);
    }

    @Override
    public long updateById(Good good) {
        GoodsMapper goodsMapper=getSqlSessionTemplate().getMapper(GoodsMapper.class);
        return goodsMapper.updateById(good);
    }

    @Override
    public long deleteById(Good good)
    {
        GoodsMapper goodsMapper=getSqlSessionTemplate().getMapper(GoodsMapper.class);
        return goodsMapper.deleteById(good);
    }
}
